$(function(){
    $("#registersubmit").click(function(){
        var message='';
        var form=document.getElementById('registerform');
        if(isFormEmpty(form, 'username')){
            message='用户名不能为空';
        }else if(isFormEmpty(form, 'email')){
            message='请输入邮箱地址';
        }else if(isFormEmpty(form, 'company_name')){
            message='请输入公司名称';
        }else if(isFormEmpty(form, 'password')){
            message='请输入密码';
        }
        if(message){
            alert(message);
        }else{
            $(form).submit();
        }
    });
});